(5874) 1989 XB is a main-belt minor planet. It was discovered by Nobuhiro Kawasato at the Uenohara Observatory on December 2, 1989.